<template>
  <div class="tb">
    <input type="text" name="q" id="q" v-model="q" placeholder="请输入关键词">
    <input type="button" value="搜索" @click="search(q)">
    <p>

    </p>
  </div>
</template>

<script>
let http = require('./../network/taobaodata');
export default {
  name: 'Body',
  data(){
    return{
      q:'',
    }
  },
  props: {
    msg: String
  },
  methods:{
    async search(q){
       let {responseText} = await http('get',`search?q=${q}`);
       let res=JSON.parse(responseText)
       let result = res.result_list.map_data
      for (let item of result) {
        console.log(item.coupon_share_url)
      }
      console.info(res)
    }
  }
}
</script>

<!-- Add "scoped" attribute to limit CSS to this component only -->
<style scoped>
h3 {
  margin: 40px 0 0;
}

ul {
  list-style-type: none;
  padding: 0;
}

li {
  display: inline-block;
  margin: 0 10px;
}

a {
  color: #42b983;
}
</style>
